/**
 * Created by 李柏霖
 * 2020/10/19 17:36
 */

package com.lbl.service.Impl;


import com.lbl.dao.IEmployeeDao;
import com.lbl.domain.Employee;
import com.lbl.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements IEmployeeService {

    @Autowired
    IEmployeeDao employeeDao;

    @Override
    public List<Employee> findAll() {
        return employeeDao.findAll();
    }

    @Override
    public Employee findById(Integer eid) {
        return employeeDao.findById(eid);
    }

    @Override
    public void save(Employee employee) {
        employeeDao.save(employee);
    }



    @Override
    public void savePersons(List<Employee> employees) {
        for (int i = 0; i <employees.size() ; i++) {
            employeeDao.save(employees.get(i));
        }
    }

    @Override
    public void deleteById(Integer eid) {
        employeeDao.deleteById(eid);
    }

    @Override
    public void update(Employee employee) {
        employeeDao.update(employee);
    }
}
